/*
 *             Copyright (C) 2024 Steve Jrong
 *
 * 	   GitHub Homepage: https://www.github.com/SteveJrong
 *      Gitee Homepage: https://gitee.com/stevejrong1024
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *        https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.stevejrong.waiter.rp.model.valueobjects;

/**
 * 值对象 - 顾客、商家用户、系统超级管理员状态
 *
 * @author Steve Jrong
 * @since 1.0
 */
public enum Status {
    ENABLE(0, true, "启用"), DISABLE(1, false, "禁用");

    /**
     * 枚举项在数据库中定义的值
     */
    private int originalVal;

    /**
     * 枚举项在应用程序（逻辑上）的值
     */
    private Boolean logicalVal;

    /**
     * 枚举项的描述
     */
    private String description;

    Status(int originalVal, Boolean logicalVal, String description) {
        this.originalVal = originalVal;
        this.logicalVal = logicalVal;
        this.description = description;
    }

    /**
     * 根据枚举项在数据库中定义的值，获取枚举对象
     *
     * @param originalVal 枚举项在数据库中定义的值
     * @return 枚举对象
     */
    public static Status getEnumByOriginalVal(int originalVal) {
        // TODO
        return Status.ENABLE;
    }

    /**
     * 根据枚举项在应用程序（逻辑上）的值，获取枚举对象
     *
     * @param logicalVal 枚举项在应用程序（逻辑上）的值
     * @return 枚举对象
     */
    public static Status getEnumByLogicalVal(Boolean logicalVal) {
        // TODO
        return Status.ENABLE;
    }

    /**
     * 根据枚举对象，枚举项在数据库中定义的值
     *
     * @param status 枚举对象
     * @return 枚举项在数据库中定义的值
     */
    public static int getOriginalValByEnum(Status status) {
        return status.originalVal;
    }

    /**
     * 根据枚举对象，获取枚举项在应用程序（逻辑上）的值
     *
     * @param status 枚举对象
     * @return 枚举项在应用程序（逻辑上）的值
     */
    public static Boolean getLogicalValByEnum(Status status) {
        return status.logicalVal;
    }

}